VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "Cafe2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
'Project Name:  Array
'Host Name:     Array.Cafe
'Date:          8/12/2004
'Version:
'Author:        Joseph Weir

' Array TD Batch processing Ctrl-F5
'
' 2004-08-12, Joseph Weir
' 2005-12-09, JFW, Code review.
'

Option Explicit
'


'---------------------------------------------------------------------------------------
' Procedure : Cafe_AfterShipment
' DateTime  : 10/22/2004
' Purpose   : Raises after a successful shipment
'---------------------------------------------------------------------------------------

Public Sub Cafe_AfterShipment(ByVal ShipmentNumber As String, ByVal IsInternational As Boolean)

    On Error GoTo Cafe_AfterShipment_Error

    If Not g_formArrayBatch Is Nothing Then
        Call ODBC1.ODBC_Insert(ShipmentNumber)
        If Not g_formArrayBatch.StartBatch(ShipmentNumber) Then
            Unload g_formArrayBatch
            Set g_formArrayBatch = Nothing
        End If
    End If
    
Release:
    Exit Sub

Cafe_AfterShipment_Error:
    MsgBox "Error - Cafe_AfterShipment - " & Err.Source & " - " & Err.Description
    Resume Release
    If False Then
        Resume
    End If
    
End Sub
'

'---------------------------------------------------------------------------------------
' Procedure : Cafe_ClearFields
' DateTime  : 10/22/2004
' Purpose   : Raises on the button click of clear fields
'---------------------------------------------------------------------------------------
'
Private Sub Cafe_ClearFields()

    On Error GoTo Cafe_ClearFields_Error

    If Not g_formArrayBatch Is Nothing Then
        Unload g_formArrayBatch
        Set g_formArrayBatch = Nothing
    End If
    
    If Not g_formCotyBatch Is Nothing Then
        Unload g_formCotyBatch
        Set g_formCotyBatch = Nothing
    End If
    
    Exit Sub

Cafe_ClearFields_Error:
    MsgBox "Error - Cafe_ClearFields - " & Err.Source & " - " & Err.Description

End Sub
'


Private Sub Cafe_DeletePackage(ByVal TrackingNumber As String, ByVal Meter As String, ByVal IsInternational As Boolean)

    On Error GoTo Cafe_DeletePackage_Error

    If Not g_formArrayBatch Is Nothing _
    Or Not g_formCotyBatch Is Nothing Then
        Call ODBC1.DeleteRecord(TrackingNumber)
    End If
    
Release:
    Exit Sub

Cafe_DeletePackage_Error:
    MsgBox "Error - Cafe_DeletePackage - " & Err.Source & " - " & Err.Description
    Resume Release

End Sub

Public Sub Cafe_SystemKeyPress(ByVal KeyName As String)

    On Error Resume Next
    
    Dim i As Long
    
    Select Case KeyName
        Case Is = "Cntrl+F4"
            Set g_formCotyBatch = New formCotyBatch
            g_formCotyBatch.Show
            i = Window.SetTopMost(g_formCotyBatch)
            Window.SetFocus (i)
            
            Unload g_formArrayBatch
            Set g_formArrayBatch = Nothing
            Unload g_formEntryBox
            Set g_formEntryBox = Nothing
            
        Case Is = "Cntrl+F5"
            Set g_formArrayBatch = New formArrayBatch
            g_formArrayBatch.Show
            i = Window.SetTopMost(g_formArrayBatch)
            Window.SetFocus (i)
    
            Unload g_formCotyBatch
            Set g_formCotyBatch = Nothing
            Unload g_formEntryBox
            Set g_formEntryBox = Nothing
    
    End Select
    
End Sub



